import { WhereOptions } from 'sequelize';
import UserModel from '@/model/mysql/user.model';

type Sql = {
  attributes?: string[];
  where?: WhereOptions,
}

export const findUser = ({ attributes, where }: Sql) => UserModel.findOne({
  attributes,
  where,
});

type User = {
  account: string;
  email?: string;
  phone?: string;
  password: string;
}
export const createUser = (user: User) => UserModel.create(user);
